<?php
include ("checkvalid.php");
$name = $_POST['username'];
$sql = "select * from dwtb where username='$name' order by id desc";
$rs = mysql_query($sql) or die("db error");
$rsArray = array();
while ($row = mysql_fetch_array($rs)) {
	array_push($rsArray, array("id"=>$row['id'], "userid"=>$checkRow['id'], "title"=>urlencode($row['title']), 
	"content"=>urlencode($row['content']), "price"=>$row['price'], "imageurls"=>$row['imageurls'], 
	"contact"=>$row['contact'], "time"=>$row['time']));
}
echo urldecode(json_encode($rsArray));
